package cn.stard.basic.config;

import cn.stard.basic.interceptor.LoginInterceptor;
import cn.stard.user.domain.Logininfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class LoginConfig implements WebMvcConfigurer {
    @Autowired
    private LoginInterceptor loginInterceptor;

    @Override
   public void addInterceptors(InterceptorRegistry registry) {
        /*添加拦截器,这里我们是登录拦截*/
        registry.addInterceptor(loginInterceptor)
                /*设置拦截所有*/
                .addPathPatterns("/**")
                /*设置放行路径*/
                .excludePathPatterns("/login/**",
                        "/verifyCode/**"
                        ,"/fastDfs/**"
                        ,"/fastDfs/"
                        ,"shop/settlement"
                        ,"/user/register/**"
                ,"/menu/list"
                ,"/menu/**");
    }

}
